<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0"></meta>
	<title>Real_Estate_4_Rent</title>
	<!-- Bootstrap Core CSS -->
   	<link href="<c:url value="/resources/admin/css/bootstrap.min.css"/>" rel="stylesheet"/>
	<!-- bootstrap carousel -->
	<link href="<c:url value="/resources/lib/bootstrap/css/carousel.css"/>" rel="stylesheet" type="text/css" />
	<link href="<c:url value="/resources/style/style.css"/>" rel = "stylesheet" type="text/css"></link>
	<!-- jQuery Version 1.11.0 -->
   	<script src="<c:url value="/resources/admin/js/jquery-1.11.0.js"/>"></script>
	<!-- /bootstrap carousel -->
	<!-- simple search css -->
	<link rel="stylesheet" href="<c:url value="/resources/style/common.css"/>" type="text/css"></link>
	<!-- /simple search css -->
	<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
 	<!-- validate email form -->
 	<!-- /validate -->
	<style>
		.loading-indicator {
		  position: fixed;
		  top: 50%;
		  left: 50%;
		  z-index: 9999;
		}
		
		.information_notify{
			background-color: #5bc0de;
			border: 1px solid #5bc0de;
			border-radius: 4px 4px 4px 4px;
			box-shadow: 0 0 8px #5bc0de;
			color: #fff;
			z-index: 9999;
		}
	</style>
</head>

<body>
		<!-- loading icon -->
		<img src="<c:url value="/resources/images/ajax-loader.gif"/>" class="loading-indicator" id="loading-indicator" style="display:none"/>
		<div class="information_notify loading-indicator" id="information_notify" style="display:none">
		<div style="display: inline-block;"><img src="<c:url value="/resources/images/tick.png"/>"/></div> A message sent to staff, successfully!
		</div>
		<!-- / loading icon -->
		<%@ include file="/WEB-INF/pages/sessionvariable.jsp" %>
		<!-- top navigation -->
		<%@ include file="/WEB-INF/pages/topnavigation.jsp" %>
		<!-- / top navigation -->
		<%@ include file="/WEB-INF/pages/simplesearch.jsp" %>
      	<!-- search form -->
      	<%@ include file="/WEB-INF/pages/searchform.jsp" %>
      	<!-- /search form -->
		<!-- information room detail -->
		<input type="hidden" name="isOpen" value="<%= session.getAttribute( "isOpen" ) %>" id="isOpenValue"/>
		<div class="container living_panel_bottom_top">
			<div class="panel panel-default">
				<div class="panel-heading">Panel heading without title</div>
			  	<div class="panel-body">
			  	<!-- set value for houses in happy homes system -->
			  	<input type="hidden" name="room_map_address" value="${listHousesInGoogleMap }" class="room_map_address"/>
				<!-- list house and information -->
				<c:forEach var="property" items="${listHouses }" varStatus="counter">
			   		<c:choose>
			    		<c:when test="${counter.count %2 != 0 && counter.count == fn:length(listHouses)}">
		    				<div class="col-md-6 col-sm-6 col-xs-12 happyhome_padding_product">
								<div class="panel panel-default living_boder_radius_shadow living_panel_bottom_top">
									<div class="panel-body">
										<div class="col-md-6 living_product_xs_device">
											<a href="${pageContext.request.contextPath}/getListRoomsInHouse?idHouse=${property.idHouse }">
											<div class="living_panel_bottom_top">
												<img src="${pageContext.request.contextPath}/${property.url }" class="img-responsive" style="height: 140px;"/>
											</div>
											</a>
										</div>
										<div class="col-md-6 living_product_xs_device living_product_font_size_line_height">
											<div class="row living_margin_left_right">Sqft: ${property.sqft} m<sup>2</sup></div>
											<div class="row living_margin_left_right happyhome_margin_top">
												<img src="${pageContext.request.contextPath}/${property.managerUrl }" class="img-responsive" style="height: 80px;"/>
											</div>
											<div class="col-md-6 living_product_xs_device">
												${property.user.fullName }
											</div>
											<div class="col-md-6 living_product_xs_device">
												${property.user.mobile }
											</div>
										</div>
										<div class="col-md-12 living_margin_left_right">
											<a href="productDetail/${property.idHouse }">
												<div id="address_detail">${property.district.nameDistrict } </div>
											</a>
											<div id="address">Address: ${property.address }</div>
										</div>
									</div>
								</div>
							</div><!-- / col-md-6-->
			    		</c:when>
			    		<c:when test="${counter.count %2 != 0}">
		    				<div class="col-md-6 col-sm-6 col-xs-12 happyhome_padding_product">
								<div class="panel panel-default living_boder_radius_shadow living_panel_bottom_top">
									<div class="panel-body">
										<div class="col-md-6 living_product_xs_device">
											<a href="${pageContext.request.contextPath}/getListRoomsInHouse?idHouse=${property.idHouse }">
												<div class="living_panel_bottom_top">
													<img src="${pageContext.request.contextPath}/${property.url }" class="img-responsive" style="height: 140px;" />
												</div>
											</a>
										</div>
										<div class="col-md-6 living_product_xs_device living_product_font_size_line_height">
											<div class="row living_margin_left_right">Sqft: ${property.sqft} m<sup>2</sup></div>
											<div class="row living_margin_left_right happyhome_margin_top">
												<img src="${pageContext.request.contextPath}/${property.managerUrl }" class="img-responsive" style="height: 80px;"/>
											</div>
											<div class="col-md-6 living_product_xs_device">
												${property.user.fullName }
											</div>
											<div class="col-md-6 living_product_xs_device">
												${property.user.mobile }
											</div>
										</div>
										<div class="col-md-12 living_margin_left_right">
											<a href="productDetail/${property.idHouse }">
												<div id="address_detail">${property.district.nameDistrict } </div>
											</a>
											<div id="address">Address: ${property.address }</div>
										</div>
									</div>
								</div>
							</div><!-- /col-md-6 -->
			  	<!-- /row </div> row -->
			    		</c:when>
			    		<c:otherwise>
			    			<!-- <div class="row"> -->
		    				<div class="col-md-6 col-sm-6 col-xs-12 happyhome_padding_product">
								<div class="panel panel-default living_boder_radius_shadow living_panel_bottom_top">
									<div class="panel-body">
										<div class="col-md-6 living_product_xs_device">
											<a href="${pageContext.request.contextPath}/getListRoomsInHouse?idHouse=${property.idHouse }">
												<div class="living_panel_bottom_top">
													<img src="${pageContext.request.contextPath}/${property.url }" class="img-responsive" style="height: 140px;"/>
												</div>
											</a>
										</div>
										<div class="col-md-6 living_product_xs_device living_product_font_size_line_height">
											<div class="row living_margin_left_right">Sqft: ${property.sqft} m<sup>2</sup></div>
											<div class="row living_margin_left_right happyhome_margin_top">
												<img src="${pageContext.request.contextPath}/${property.managerUrl }" class="img-responsive" style="height: 80px;"/>
											</div>
											<div class="col-md-6 living_product_xs_device">
												${property.user.fullName }
											</div>
											<div class="col-md-6 living_product_xs_device">
												${property.user.mobile }
											</div>
										</div>
										<div class="col-md-12 living_margin_left_right">
											<a href="productDetail/${property.idHouse }">
												<div id="address_detail">${property.district.nameDistrict } </div>
											</a>
											<div id="address">Address: ${property.address }</div>
										</div>
									</div>
								</div>
							</div><!-- /col-md-6 -->
			    		</c:otherwise>
			    	</c:choose>
			    </c:forEach>
				<!-- /list house and information -->
			  	<!-- map container -->
			  	<div class="col-md-12 col-sm-12 col-xs-12">
					<label>Houses in Happy Homes</label>
					<div id="map_container" style="height:500px;">
					</div>
				</div>
			  	<!-- /map container -->
				<!-- Send enquiry -->
				<div class="col-md-12 col-sm-12 col-xs-12">
					<label>Send Enquiry</label><hr/>
				</div>
				<div class="col-md-4 col-sm-4 col-xs-12">
				   	<div class="row living-padding-lr">Mr Son</div>
				   	<div class="row living-padding-lr">
				   		<div class="col-md-8 col-md-offset-2 col-sm-8 col-sm-offset-2 col-xs-8 col-xs-offset-2">
			   				<img src="<c:url value=""/>" style="width:100%;"/>
			   			</div>
				   	</div>
				    <div class="row living-padding-lr">Company: Living Home Stay</div>
					<div class="row living-padding-lr">Mobile:(+84) 1643 770 510</div>
				</div><!-- /col-md-4 col-sm-4 col-xs-12 -->
				<div class="col-md-8 col-sm-8 col-xs-12">
					    <form class="form-horizontal" role="form" id="form_enquiry">
						  	<div class="form-group has-feedback" id="form_group_name">
							    <label class="control-label col-md-3 col-sm-3 col-xs-12 living_font_weight">
							    	Name&nbsp;<div id="special_mark">*</div>
							    </label>
							    <div class="col-md-5 col-sm-5 col-xs-12">
							      <input type="text" class="form-control" name="name" id="name_enquiry"></input>
							      <span class="glyphicon glyphicon-ok form-control-feedback" style="display:none;" id="name_glyphicon_ok"></span>
							      <span class="glyphicon glyphicon-remove form-control-feedback" style="display:none;" id="name_glyphicon_remove"></span>
							    </div>
					  		</div>
						  <div class="form-group has-feedback" id="form_group_email">
						    <label class="control-label col-md-3 col-sm-3 col-xs-12 living_font_weight">
						    	Email&nbsp;<div id="special_mark">*</div>
						    </label>
						    <div class="col-md-5 col-sm-5 col-xs-12">
						      <input type="text" class="form-control" name="email" id="email_enquiry"></input>
						       <span class="glyphicon glyphicon-ok form-control-feedback" style="display:none;" id="email_glyphicon_ok"></span>
						       <span class="glyphicon glyphicon-remove form-control-feedback" style="display:none;" id="email_glyphicon_remove"></span>
						    </div>
						    <div class="col-md-5 col-md-offset-3 col-sm-5 col-sm-offset-3 col-xs-12" id="validate_email_error" style="display: none;">
						    	<label class="living_font_weight" style="color:#a94442;">Please enter a valid email address</label>
					    	</div>
						  </div>
						  <div class="form-group has-feedback" id="form_group_number">
						    <label class="control-label col-md-3 col-sm-3 col-xs-12 living_font_weight">
						    	Contact Number&nbsp;<div id="special_mark">*</div>
						    </label>
						    <div class="col-md-5 col-sm-5 col-xs-12">
						      <input type="text" class="form-control" name="contactNumber" id="number_enquiry"
						      	onkeypress='return (event.charCode >= 48 && event.charCode <= 57) || event.charCode == 8 || event.charCode == 46' maxlength="11"></input>
						       <span class="glyphicon glyphicon-ok form-control-feedback" style="display:none;" id="number_glyphicon_ok"></span>
						       <span class="glyphicon glyphicon-remove form-control-feedback" style="display:none;" id="number_glyphicon_remove"></span>
						    </div>
						  </div>
						  <div class="form-group has-feedback" id="form_group_enquiry">
						    <label class="control-label col-md-3 col-sm-3 col-xs-12 living_font_weight">
						    	Enquiry&nbsp;<div id="special_mark">*</div>
						    </label>
						    <div class="col-md-9 col-sm-9 col-xs-12">
						      <textarea class="form-control" id="en_enquiry" name="enquiry"></textarea>
						      <span class="glyphicon glyphicon-ok form-control-feedback" style="display:none;" id="enquiry_glyphicon_ok"></span>
						      <span class="glyphicon glyphicon-remove form-control-feedback" style="display:none;" id="enquiry_glyphicon_remove"></span>
						    </div>
						  </div>
						  <div class="form-group">
						    <label class="col-md-3 col-sm-3 col-xs-12">
						    	&nbsp;
						    </label>
						    <div class="col-md-9 col-sm-9 col-xs-12">
						      <input type="submit" value="Submit" class="btn btn-info"></input>
						    </div>
						  </div>
					</form>
				</div>
				<!-- /Send enquiry -->
			  </div><!-- / panel body -->
			</div>
		</div>	<!-- /container -->
		<!-- /information room detail-->
		<!-- related room -->
		<c:if test="${not empty relaterooms}">
	  	<div class="container living_panel_bottom_top">
	  		<div class="panel panel-default">
			  	<div class="panel-heading living_transparent_color living_font_size_header">
			    	<h3 class="panel-title"><a href="resultProperty.html">More ${room.brtbCategory.categoryName } for ${room.typeroom }</a></h3>
			  	</div>
		  		<div class="panel-body">
		  			<c:forEach var="property" items="${relaterooms }" varStatus="counter">
				   		<c:choose>
				    		<c:when test="${counter.count %2 != 0 && counter.count == fn:length(relaterooms)}">
				    			<div class="row">
				    				<div class="col-md-6 col-sm-6 col-xs-12">
										<div class="panel panel-default living_boder_radius_shadow living_panel_bottom_top">
											<div class="panel-body">
												<div class="row">
													<div class="col-md-6 living_room_xs_device">
														<a href="roomDetail/${property.id }">
														<div class="living_panel_bottom_top">
															<img src="<c:url value="/resources/images/7district.jpg"/>" class="img-responsive"/>
														</div>
														</a>
													</div>
													<div class="col-md-6 living_room_xs_device living_room_font_size_line_height">
														<div class="row living_margin_left_right">
															${property.special} <div id="special_mark">*</div>
														</div>
														<div class="row living_margin_left_right">
															<div style="width:45%; display:inline-block;">
																Room: ${property.room}
															</div>
															<div style="width:50%; display:inline-block;">
																Bedroom: ${property.bedroom}
															</div>
														</div>
														<div class="row living_margin_left_right">Sqft: ${property.sqft} sqm</div>
														<div class="row living_margin_left_right">Interior: ${property.brtbInterior.interiorName}</div>
														<div class="row living_margin_left_right">Price: 
															<div id="special_mark">${property.price} USD/month</div>
														</div>
														<div class="row living_margin_left_right">
															<div id="characteristic_favorite">
																<img src="<c:url value="/resources/images/favorite.jpg"/>" style="width:20px; height:20px;"> &nbsp;Add favorites
															</div>
														</div>
													</div>
												</div>
												<div class="row living_margin_left_right">
													<div id="address">Address: ${property.address}</div>
													<a href="roomDetail/${property.id }">
														<div id="address_detail">${property.roomName}</div>
													</a>
												</div>
											</div>
										</div>
									</div><!-- / col-md-6-->
				    			</div><!-- /row -->
				    		</c:when>
				    		<c:when test="${counter.count %2 != 0}">
				    			<div class="row">
				    				<div class="col-md-6 col-sm-6 col-xs-12">
										<div class="panel panel-default living_boder_radius_shadow living_panel_bottom_top">
											<div class="panel-body">
												<div class="row">
													<div class="col-md-6 living_room_xs_device">
														<a href="roomDetail/${property.id }">
														<div class="living_panel_bottom_top">
															<img src="<c:url value="/resources/images/7district.jpg"/>" class="img-responsive"/>
														</div>
														</a>
													</div>
													<div class="col-md-6 living_room_xs_device living_room_font_size_line_height">
														<div class="row living_margin_left_right">
															${property.special} <div id="special_mark">*</div>
														</div>
														<div class="row living_margin_left_right">
															<div style="width:45%; display:inline-block;">
																Room: ${property.room}
															</div>
															<div style="width:50%; display:inline-block;">
																Bedroom: ${property.bedroom}
															</div>
														</div>
														<div class="row living_margin_left_right">Sqft: ${property.sqft} sqm</div>
														<div class="row living_margin_left_right">Interior: ${property.brtbInterior.interiorName}</div>
														<div class="row living_margin_left_right">Price: 
															<div id="special_mark">${property.price} USD/month</div>
														</div>
														<div class="row living_margin_left_right">
															<div id="characteristic_favorite">
																<img src="<c:url value="/resources/images/favorite.jpg"/>" style="width:20px; height:20px;"> &nbsp;Add favorites
															</div>
														</div>
													</div>
												</div>
												<div class="row living_margin_left_right">
													<div id="address">Address: ${property.address}</div>
													<a href="roomDetail/${property.id }">
														<div id="address_detail">${property.roomName}</div>
													</a>
												</div>
											</div>
										</div>
									</div><!-- /col-md-6 -->
				  	<!-- /row </div> row -->
				    		</c:when>
				    		<c:otherwise>
				    			<!-- <div class="row"> -->
				    				<div class="col-md-6 col-sm-6 col-xs-12">
										<div class="panel panel-default living_boder_radius_shadow living_panel_bottom_top">
											<div class="panel-body">
												<div class="row">
													<div class="col-md-6 living_room_xs_device">
														<a href="roomDetail/${property.id }">
														<div class="living_panel_bottom_top">
															<img src="<c:url value="/resources/images/7district.jpg"/>" class="img-responsive"/>
														</div>
														</a>
													</div>
													<div class="col-md-6 living_room_xs_device living_room_font_size_line_height">
														<div class="row living_margin_left_right">
															${property.special} <div id="special_mark">*</div>
														</div>
														<div class="row living_margin_left_right">
															<div style="width:45%; display:inline-block;">
																Room: ${property.room}
															</div>
															<div style="width:50%; display:inline-block;">
																Bedroom: ${property.bedroom}
															</div>
														</div>
														<div class="row living_margin_left_right">Sqft: ${property.sqft} sqm</div>
														<div class="row living_margin_left_right">Interior: ${property.brtbInterior.interiorName}</div>
														<div class="row living_margin_left_right">Price: 
															<div id="special_mark">${property.price} USD/month</div>
														</div>
														<div class="row living_margin_left_right">
															<div id="characteristic_favorite">
																<img src="<c:url value="/resources/images/favorite.jpg"/>" style="width:20px; height:20px;"> &nbsp;Add favorites
															</div>
														</div>
													</div>
												</div>
												<div class="row living_margin_left_right">
													<div id="address">Address: ${property.address}</div>
													<a href="roomDetail/${property.id }">
														<div id="address_detail">${property.roomName}</div>
													</a>
												</div>
											</div>
										</div>
									</div><!-- /col-md-6 -->
				  				</div><!-- /row -->
				    		</c:otherwise>
				    	</c:choose>
				    </c:forEach>
				    <div class="row pull-right living_margin_left_right"><a href="resultProperty?categoryCode=ALL&pageSize=6&page=1">More...</a></div>
				</div><!-- /panel-body -->
			</div><!-- / panel panel-default -->
		</div><!-- /container -->
	</c:if><!-- related properties -->
	<!-- like facebook component -->
	<div class="container">
      <div id="likeFaceBookComponent">
      </div>
    </div>
    <!-- /like facebook component -->
	
	<!-- footer navigation -->
	<a href="#" id="backToTop" class="backToTop">
		<img src="<c:url value="/resources/images/top.png"/>"/> 
	</a>
	<!-- bootstrap javascript -->
   	<script src="<c:url value="/resources/admin/js/bootstrap.min.js"/>"></script>
	<!-- /bootstrap javascript -->
	<script type="text/javascript">
		$(document).ready(function(){
			initialize();

			scrollVariable = false;
			$(window).on("resize", function () {
		        if ($(window).width() > 767 && $('#top-navbar-toggle').is(':hidden')) {
		            $(selected).removeClass('slide-active');
		        }
		    });
		
		    $(window).scroll(function(){
		        if ($(this).scrollTop() > 100) {
		            $('#backToTop').fadeIn('slow');
		            if(scrollVariable == false){
			        	var container_width = $('.container').width();
				        var likeFaceBookIframe = '<iframe src="http://www.facebook.com/plugins/likebox.php?href=https://www.facebook.com/congdongvnexpress&amp;width=' + container_width + '&amp;height=214&amp;colorscheme=light&amp;show_faces=true&amp;border_color&amp;stream=false&amp;header=true&amp;appId=145923738846814" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100%; height:214px;" allowtransparency="true"></iframe>';
				
				        $('#likeFaceBookComponent').html(likeFaceBookIframe);
				        scrollVariable = true;
			        }
		        } else {
		            $('#backToTop').fadeOut('slow');
		        }
		    });
		    $('#backToTop').click(function(){
		        $("html, body").animate({ scrollTop: 0 }, 2000);
		        return false;
		    });
		});
		
		function initialize() {
		  var mapOptions = {
		    zoom: 13,
		    center: new google.maps.LatLng(10.771839, 106.698167)
		  };
		  var map = new google.maps.Map(document.getElementById('map_container'),
		                                mapOptions);
		  var beaches = $(".room_map_address").val(); 
		  setMarkers(map, beaches);
		}
		/**
		 * Data for the markers consisting of a name, a LatLng and a zIndex for
		 * the order in which these markers should display on top of each
		 * other.
		 */
		function setMarkers(map, locations) {
		  // Add markers to the map

		  // Marker sizes are expressed as a Size of X,Y
		  // where the origin of the image (0,0) is located
		  // in the top left of the image.

		  // Origins, anchor positions and coordinates of the marker
		  // increase in the X direction to the right and in
		  // the Y direction down.
		  var image = {
		    url: '/HappyHome/resources/images/beachflag.png',
		    // This marker is 20 pixels wide by 32 pixels tall.
		    size: new google.maps.Size(20, 32),
		    // The origin for this image is 0,0.
		    origin: new google.maps.Point(0,0),
		    // The anchor for this image is the base of the flagpole at 0,32.
		    anchor: new google.maps.Point(0, 32)
		  };
		  // Shapes define the clickable region of the icon.
		  // The type defines an HTML &lt;area&gt; element 'poly' which
		  // traces out a polygon as a series of X,Y points. The final
		  // coordinate closes the poly by connecting to the first
		  // coordinate.
		  var shape = {
		      coords: [1, 1, 1, 20, 18, 20, 18 , 1],
		      type: 'poly'
		  };
		  var location = locations.split("]");
		  for (var i = 0; i < location.length; i++) {
		    var beach = location[i];
		    var abc = beach.split(",");
		    var myLatLng = new google.maps.LatLng(abc[1], abc[2]);
		    var marker = new google.maps.Marker({
		        position: myLatLng,
		        map: map,
		        icon: image,
		        shape: shape,
		        title: abc[0],
		        zIndex: 1
		    });
		  }
		}
	</script>
  	<!-- enquiryform javascript -->
  	<script src="<c:url value="/resources/js/enquiryform.js"/>"></script>
  	<!-- / enquiryform javascript -->
  	
  	<!-- jQuery Version 1.11.0 -->
   	<script src="<c:url value="/resources/admin/js/jquery-1.11.0.js"/>"></script>
	<!-- Bootstrap Core JavaScript -->
   	<script src="<c:url value="/resources/admin/js/bootstrap.min.js"/>"></script>
   
   	<!-- multiple select -->
    <script type="text/javascript" src="<c:url value="/resources/admin/js/bootstrap-multiselect.js"/>"></script>
	<!-- /multiple select -->
	<!-- range slider -->
  	<script src="<c:url value="/resources/themes/jquery-ui/jquery-ui.js"/>"></script>
  	<!-- /range slider -->
  	<!-- common javascript -->
  	<script src="<c:url value="/resources/js/common.js"/>"></script>
  	<!-- / common javascript -->
</body>
</html>
